<?xml version="1.0" encoding="utf-8" ?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:iepd="http://dps.state.tx.us/niem/exchange/DispositionReport/1.0" xmlns:tx="http://dps.state.tx.us/niem/extensions/1.0" xmlns:j="http://niem.gov/niem/domains/jxdm/4.0" xmlns:scr="http://niem.gov/niem/domains/screening/2.0" xmlns:s="http://niem.gov/niem/structures/2.0" xmlns:ansi-nist="http://niem.gov/niem/ansi-nist/2.0" xmlns:nc="http://niem.gov/niem/niem-core/2.0">

<xsl:import href="TXCommon.xslt"/>
<xsl:output method="text" encoding="UTF-8"/>
	<xsl:template match="/">
		<xsl:text>&#10;</xsl:text>
		<xsl:text>                                                DISPOSITION REPORT</xsl:text>
		<xsl:text>&#10;________________________________________________________________________________________________________________________</xsl:text>
		<xsl:text>&#10;Court ORI:     </xsl:text>
		<xsl:text>Court Name:                   </xsl:text>
		<xsl:text>Cause Number: </xsl:text>
		<xsl:text>&#10;</xsl:text>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="15"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//j:CaseAugmentation/tx:CaseCourt/j:OrganizationAugmentation/j:OrganizationORIIdentification/nc:IdentificationID"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="30"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//j:CaseAugmentation/tx:CaseCourt/j:OrganizationAugmentation/j:OrganizationJurisdiction/nc:LocationCountyName"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:value-of select="//tx:Case/nc:CaseTrackingID"/>
		<xsl:text>&#10;________________________________________________________________________________________________________________________</xsl:text>
		<xsl:text>&#10;GOC: </xsl:text>
		<xsl:text>Domestic Violence:  </xsl:text>
		<xsl:text>Offense Code:  </xsl:text>
		<xsl:text>Offense:                      </xsl:text>
		<xsl:text>Statute Citation:        </xsl:text>
		<xsl:text>Degree of Disp. Offense: </xsl:text>
		<xsl:text>&#10;</xsl:text>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="5"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//tx:CaseConvictionCharge/j:ChargeQualifierText"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="20"/>
			<xsl:with-param name="data">
				<xsl:if test="//j:CaseDomesticViolenceIndicator='true'">Y</xsl:if>
				<xsl:if test="//j:CaseDomesticViolenceIndicator='false'">N</xsl:if>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="15"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//tx:CaseConvictionCharge/j:ChargeNCICCode"/>
				<xsl:value-of select="//tx:CaseConvictionCharge/tx:ChargeNCICTexasSuffixCode"/>
			</xsl:with-param>
		</xsl:call-template>
	
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="30"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//tx:CaseConvictionCharge/j:ChargeDescriptionText"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="25"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//tx:CaseConvictionCharge/j:ChargeLegalDescriptionText"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:value-of select="//tx:CaseConvictionCharge/j:ChargeSeverityText"/>
		<xsl:text>:</xsl:text>
		<xsl:value-of select="//tx:CaseConvictionCharge/j:ChargeDegreeText"/>
		<xsl:text>&#10;________________________________________________________________________________________________________________________</xsl:text>
		<xsl:text>&#10;Final Plea:         </xsl:text>
		<xsl:text>Court Disposition Date:  </xsl:text>
		<xsl:text>Sentence Date:           </xsl:text>
		<xsl:text>Court Disposition (CDN): </xsl:text>
		<xsl:text>Court Cost: </xsl:text>
		<xsl:text>&#10;</xsl:text>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="20"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//tx:CaseConvictionCharge/tx:ChargePlea/j:PleaDescriptionText"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="25"/>
			<xsl:with-param name="data">
				<xsl:call-template name="FormatDate">
					<xsl:with-param name="FullDate">
						<xsl:value-of select="substring-before(//tx:CaseAugmentation/tx:ChargeDisposition/nc:DispositionDate/nc:DateTime,'T')"/>
					</xsl:with-param>
				</xsl:call-template>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="25"/>
			<xsl:with-param name="data">
				<xsl:call-template name="FormatDate">
					<xsl:with-param name="FullDate">
						<xsl:value-of select="//tx:ConvictionSentence/tx:SentenceAugmentation/tx:SentenceImposedDate/nc:Date"/>
					</xsl:with-param>
				</xsl:call-template>
			</xsl:with-param>
		</xsl:call-template>
		
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="25"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//tx:CaseAugmentation/tx:ChargeDisposition/tx:ChargeDispositionAugmentation/tx:DispositionCategoryCode"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:text>$</xsl:text>
		<xsl:value-of select="//tx:ConvictionSentence/tx:SentenceAugmentation/tx:CourtCosts/nc:ObligationTotalAmount"/>
		<xsl:text>&#10;________________________________________________________________________________________________________________________</xsl:text>
		<xsl:text>&#10;</xsl:text>
		<xsl:text>Confinement:             </xsl:text>
		<xsl:text>Sentence Susp. - Time:   </xsl:text>
		<xsl:text>Probation:          </xsl:text>
		<xsl:text>Fine:     </xsl:text>
		<xsl:text>Sent. Susp - Fine:  </xsl:text>
		<xsl:text>Multiple Sentences: </xsl:text>
		<xsl:text>&#10;</xsl:text>
	
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="25"/>
			<xsl:with-param name="data">
				<xsl:if test="not(//j:Conviction/tx:ConvictionSentence/j:SentenceSuspendedIndicator='true') and not(//j:Conviction/tx:ConvictionSentence/tx:SentenceAugmentation/tx:CommunitySupervision)">
					<xsl:value-of select="substring-after(substring-before(//j:Conviction/tx:ConvictionSentence/tx:SentenceTerm/j:TermDuration,'T'),'P')"/>
				</xsl:if>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="25"/>
			<xsl:with-param name="data">
				<xsl:if test="//j:Conviction/tx:ConvictionSentence/j:SentenceSuspendedIndicator='true'">
					<xsl:value-of select="substring-after(substring-before(//j:Conviction/tx:ConvictionSentence/tx:SentenceTerm/j:TermDuration,'T'),'P')"/>
				</xsl:if>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="20"/>
			<xsl:with-param name="data">
				<xsl:if test="//j:Conviction/tx:ConvictionSentence/j:SentenceSuspendedIndicator='true' or //j:Conviction/tx:ConvictionSentence/tx:SentenceAugmentation/tx:CommunitySupervision">
					<xsl:value-of select="substring-after(substring-before(//j:Conviction/tx:ConvictionSentence/tx:SentenceTerm/j:TermDuration,'T'),'P')"/>
				</xsl:if>
			</xsl:with-param>
		</xsl:call-template>
		
		<xsl:text>$</xsl:text>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="9"/>
			<xsl:with-param name="data">
				<xsl:if test="not(//j:Conviction/tx:ConvictionSentence/j:SentenceSuspendedIndicator='true')">
					<xsl:value-of select="//tx:ConvictionSentence/tx:SentenceAugmentation/tx:Fine/nc:ObligationTotalAmount"/>
				</xsl:if>
			</xsl:with-param>
		</xsl:call-template>

		<xsl:text>$</xsl:text>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="19"/>
			<xsl:with-param name="data">
				<xsl:if test="//j:Conviction/tx:ConvictionSentence/j:SentenceSuspendedIndicator='true'">
						<xsl:value-of select="//tx:ConvictionSentence/tx:SentenceAugmentation/tx:Fine/nc:ObligationTotalAmount"/>
				</xsl:if>
			</xsl:with-param>
		</xsl:call-template>

		<xsl:value-of select="//j:Conviction/tx:ConvictionSentence/j:SentenceGroupingText"/>
		<xsl:text>&#10;________________________________________________________________________________________________________________________</xsl:text>
		
		<xsl:text>&#10;Court Provision (CPN):   </xsl:text>
		<xsl:text>Court Provision Literal (CPL): </xsl:text>
		<xsl:text>&#10;</xsl:text>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="25"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//tx:AppellateCase/tx:AppellateCaseAugmentation/tx:ChargeDisposition/tx:ChargeDispositionAugmentation/tx:ChargeDispositionProvision/tx:ChargeDispositionProvisionCategoryCode"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:value-of select="//tx:AppellateCase/tx:AppellateCaseAugmentation/tx:ChargeDisposition/tx:ChargeDispositionAugmentation/tx:ChargeDispositionProvision/tx:ChargeDispositionProvisionCategoryText"/>
		<xsl:text>&#10;________________________________________________________________________________________________________________________</xsl:text>
		
		<xsl:text>&#10;Agency To Receive Custody:    </xsl:text>
		<xsl:text>Appeal Date:   </xsl:text>
		<xsl:text>Offender Status During Appeal:     </xsl:text>
		<xsl:text>Result of Appeal: </xsl:text>
		<xsl:text>&#10;</xsl:text>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="30"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//tx:ReceivingAgency/nc:OrganizationName"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="15"/>
			<xsl:with-param name="data">
				<xsl:call-template name="FormatDate">
					<xsl:with-param name="FullDate">
						<xsl:value-of select="substring-before(//tx:AppellateCase/tx:AppellateCaseAugmentation/tx:AppellateCaseAppealDate/nc:DateTime,'T')"/>
					</xsl:with-param>
				</xsl:call-template>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="35"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//tx:AppellateCase/tx:AppellateCaseAugmentation/nc:SupervisionCustodyStatus/nc:StatusText"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:value-of select="//tx:AppellateCase/j:AppellateCaseDecision/j:AppellateCaseDecisionCategoryText"/>
		<xsl:text>&#10;________________________________________________________________________________________________________________________</xsl:text>
		
		<xsl:text>&#10;Beginning Date of Suspension:      </xsl:text>
		<xsl:text>Education Programs:      </xsl:text>
		<xsl:text>Education Required:           </xsl:text>
		<xsl:text>Education Waived: </xsl:text>
		<xsl:text>&#10;</xsl:text>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="35"/>
			<xsl:with-param name="data">
				<xsl:call-template name="FormatDate">
					<xsl:with-param name="FullDate">
						<xsl:value-of select="//j:Conviction/tx:ConvictionSentence/tx:SentenceAugmentation/nc:DriverLicenseWithdrawal/nc:DriverLicenseWithdrawalEffectiveDate/nc:Date"/>
					</xsl:with-param>
				</xsl:call-template>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="25"/>
			<xsl:with-param name="data">
				<xsl:value-of select="//tx:Program/tx:ProgramAugmentation/tx:ProgramCategoryCode"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="30"/>
			<xsl:with-param name="data">
				<xsl:call-template name="FormatDate">
					<xsl:with-param name="FullDate">
						<xsl:value-of select="//tx:Program/tx:ProgramAugmentation/tx:ProgramRequiredDate/nc:Date"/>
					</xsl:with-param>
				</xsl:call-template>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="FormatDate">
			<xsl:with-param name="FullDate">
				<xsl:value-of select="//tx:Program/tx:ProgramAugmentation/tx:ProgramWaivedDate/nc:Date"/>
			</xsl:with-param>
		</xsl:call-template>
		
		<xsl:text>&#10;____________________________</xsl:text>
		<xsl:text>                                </xsl:text>
		<xsl:text>__________________            </xsl:text>
		<xsl:text>________________</xsl:text>
		<xsl:text>&#10;Ending Date of Suspension:    </xsl:text>
		<xsl:text>                              </xsl:text>
		<xsl:text>Education Completed:          </xsl:text>
		<xsl:text>Interlock Required: </xsl:text>
		<xsl:text>&#10;</xsl:text>
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="60"/>
			<xsl:with-param name="data">
				<xsl:call-template name="FormatDate">
					<xsl:with-param name="FullDate">
						<xsl:value-of select="//j:Conviction/tx:ConvictionSentence/tx:SentenceAugmentation/nc:DriverLicenseWithdrawal/nc:DriverLicenseWithdrawalEligibilityDate/nc:Date"/>
					</xsl:with-param>
				</xsl:call-template>
			</xsl:with-param>
		</xsl:call-template>
		
		<xsl:call-template name="pad">
			<xsl:with-param name="amount" select="30"/>
			<xsl:with-param name="data">
				<xsl:call-template name="FormatDate">
					<xsl:with-param name="FullDate">
						<xsl:value-of select="//tx:Program/tx:ProgramAugmentation/tx:ProgramCompletedDate/nc:Date"/>
					</xsl:with-param>
				</xsl:call-template>
			</xsl:with-param>
		</xsl:call-template>
		
		<xsl:if test="//tx:SpecialOrder/tx:SpecialOrderName='Interlock Required'">Y</xsl:if>
		<xsl:if test="not(//tx:SpecialOrder/tx:SpecialOrderName='Interlock Required')">N</xsl:if>
		<xsl:text>&#10;________________________________________________________________________________________________________________________</xsl:text>
		<xsl:text>&#10;Date:</xsl:text>
		<xsl:text>&#10;</xsl:text>
		<xsl:call-template name="FormatDate">
			<xsl:with-param name="FullDate">
				<xsl:value-of select="substring-before(//nc:DocumentCreationDate/nc:DateTime,'T')"/>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:text>&#10;________________________________________________________________________________________________________________________</xsl:text>

	</xsl:template>

	
</xsl:stylesheet>


	

